Skip to content

Component custom prefix option #4740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dreitzner
Copy link
Contributor

Add the option to pass a custom prefix to the compiler.

  • Fallback will be svelte-
  • prefix is checked for validity as a class selector

Tests were run:
npm run test -- -g css with .solo on the newly added tests
test

@dreitzner
Copy link
Contributor Author

Needs some work in test\css\index.js:87 => use src\compiler\compile\utils\get_prefix.ts

@Conduitry
Copy link
Member

Related to existing PR #4377, where I think one of the main blockers was figuring out a sensible name for the feature. That allows the class name to be computed by an arbitrary callback - which I think is the correct general solution - but does not handle customizing the <head> labels. It would be nice to handle all of this at once, but I'm not sure how the API should work.

@dreitzner
Copy link
Contributor Author

@Conduitry I'll remove the head implementation and fix the tests, and then jump over to PR #4377. I think it would be nice to have 2 interfaces, a simple (only prefix changes) and a more advanced one, where you can pass your own hash/id function as is already implemented there.

@Conduitry
Copy link
Member

Closing in favor of #4377. Being able to customize this is a niche and cosmetic thing, so I don't think there needs to be two different ways to do it. If someone would care enough to want this, they could figure slightly more powerful API that the other PR would offer.

@Conduitry Conduitry closed this Jun 10, 2020
@dreitzner dreitzner deleted the component-custom-prefix-option branch January 22, 2021 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants